using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities.Auditing;

namespace BW.WMS.WareHouseManage
{
    /// <summary>
    /// 库区实体
    /// </summary>
    public class Zone : FullAuditedEntity<Guid>
    {
        /// <summary>
        /// 所属仓库ID
        /// </summary>
        public Guid WarehouseId { get; set; }
        
        /// <summary>
        /// 库区编码
        /// </summary>
        public string Code { get; set; }
        
        /// <summary>
        /// 库区名称
        /// </summary>
        public string Name { get; set; }
        
        /// <summary>
        /// 库区类型 (1-普通区，2-冷藏区，3-危险品区，4-贵重品区)
        /// </summary>
        public int ZoneType { get; set; }
        
        /// <summary>
        /// 状态 (0-停用，1-启用)
        /// </summary>
        public int Status { get; set; }
        
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 面积（平方米）
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal Area { get; set; }
        
        // 导航属性 - 所属仓库
        public virtual Warehouse Warehouse { get; protected set; }
        
        // 导航属性 - 库位集合
        public virtual ICollection<Location> Locations { get; protected set; }
        
        protected Zone()
        {
            Locations = new List<Location>();
        }
        
        public Zone(
            Guid id,
            Guid warehouseId,
            string code,
            string name,
            int zoneType = 1,
            int status = 1) : base(id)
        {
            WarehouseId = warehouseId;
            Code = code;
            Name = name;
            ZoneType = zoneType;
            Status = status;
            Locations = new List<Location>();
        }
    }
} 